
<?php 

$keyname="ButterflyPortal_data_OPTIONS_VALUE_".$currentObject->fieldname;
?>




<?php 




//echo $currentObject->options_value;
$options=str_split($currentObject->options_value);

$operation=array("List","Add","Edit","View","ReadOnly","Hidden Add");
$ops=array("L","A","C","V","R","K");
$i=0;
foreach ($operation as $op)
{
	$checked="";
	if (in_array($ops[$i], $options)) $checked="checked";
?>
<td>
<div style="text-align: center;">
<?php if ($i==0) {?>
<input  type="hidden" name="<?=$keyname?>" id="<?=$keyname?>"  size="20" value="<?=$currentObject->options_value?>" />
<?php } ?>
<input type="checkbox" name="operations_<?=$currentObject->fieldname?>" <?=$checked?> id="operations_<?=$op?>_<?=$currentObject->fieldname?>" value="<?=$ops[$i]?>" />
</div>
</td>
<?php
$i++;
}
?>




<script>
$('input[name="operations_<?=$currentObject->fieldname?>"]').change(function () {
	str=$("#<?=$keyname?>").val();
	value=$(this).attr("value");
	str=str.replace(value,"");
if($(this).is(":checked"))
{
	
	str=str+value;
	

}else{

	
}

$("#<?=$keyname?>").val(str);

ajaxedittable("portal_tables_fields",<?=$currentObject->id?>,"options_value",str);

});
</script>
<td>
<img src="images/up.png" border="0" title="Up" onclick="changeOrder('Up','portal_tables_fields',<?=$currentObject->id?>,$(this))" class="clickable"></a>
<img src="images/down.png" border="0" title="Down" onclick="changeOrder('Down','portal_tables_fields',<?=$currentObject->id?>,$(this))" class="clickable"></a>

</td>
<td>


<select name="viewtag_<?=$currentObject->fieldname?>">
<?php 

$operation=get_enum_values("portal_tables_fields", "viewtag");

$i=0;
foreach ($operation as $op)
{
	$selected="";
	if ($op==$currentObject->edittag) $selected="selected";
?>
<option <?=$selected?> value="<?=$op?>"><?=$op?></option>
<?php }?>
</select>

<script>
viewTagvalue="";
$('select[name="viewtag_<?=$currentObject->fieldname?>"]').change(function () {

	viewTagvalue=$(this).val();


ajaxedittable("portal_tables_fields",<?=$currentObject->id?>,"viewtag",viewTagvalue);

});
</script>

</td>
<td>


<select name="edittag_<?=$currentObject->fieldname?>">
<?php 

$operation=get_enum_values("portal_tables_fields", "edittag");

$i=0;
foreach ($operation as $op)
{
	$selected="";
	if ($op==$currentObject->edittag) $selected="selected";
?>
<option <?=$selected?> value="<?=$op?>"><?=$op?></option>
<?php }?>
</select>

<script>
editTagvalue="";
$('select[name="edittag_<?=$currentObject->fieldname?>"]').change(function () {

	editTagvalue=$(this).val();


ajaxedittable("portal_tables_fields",<?=$currentObject->id?>,"edittag",editTagvalue);

});
</script>
</td>
